import request from '@/utils/request'

export function getAliToken() {
  return request({
    url: '/admin/v1/oss/ali/policy',
    method: 'get'
  })
}

export function getQiniuToken() {
  return request({
    url: '/admin/v1/oss/qiniu/policy',
    method: 'get'
  })
}

export function getOssList(data) {
  return request({
    url: '/admin/v1/oss/list',
    method: 'get',
    params: data
  })
}

export function getConfig() {
  return request({
    url: '/admin/v1/oss/config',
    method: 'get'
  })
}

export function saveConfig(data) {
  return request({
    url: '/admin/v1/oss/saveConfig',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    url: '/admin/v1/oss/delete',
    method: 'delete',
    data
  })
}

export function delByUrl(data) {
  return request({
    url: '/admin/v1/oss/delete',
    method: 'delete',
    params: data
  })
}

export function saveAliOss(data) {
  return request({
    url: '/admin/v1/oss/save',
    method: 'post',
    data
  })
}

